import Vue from 'vue'

const Mock = require('mockjs')

Vue.prototype.$mock = () => {
  return Mock.mock({
    'limits|1': ['usr', 'admin'],
    today_task_list: {
      'data|30-50': [{
        duty: () => {
          return Mock.Random.integer(0, 1)
        },
        effect: () => {
          return Mock.Random.boolean()
        },
        expired: () => {
          return Mock.Random.boolean()
        },
        station: () => {
          return Mock.Random.cword(3, 5)
        },
        status: () => {
          return Mock.Random.integer(0, 4)
        },
        tag: () => {
          return Mock.Random.cword(2)
        },
        time: () => {
          return Mock.Random.time('HH:mm')
        },
        title: () => {
          return Mock.Random.ctitle(5, 10)
        }
      }]
    },
    normal_task_list: {
      'data|30-50': [{
        checked: () => {
          return Mock.Random.boolean()
        },
        tag: () => {
          return Mock.Random.cword(2)
        },
        title: () => {
          return Mock.Random.ctitle(5, 10)
        }
      }]
    },
    member_list: {
      'data|30-50': [{
        name: () => {
          return Mock.Random.cname()
        },
        rest: () => {
          return Mock.Random.boolean()
        },
        status: () => {
          return Mock.Random.integer(0, 1)
        },
        title: () => {
          return Mock.Random.ctitle(5, 10)
        }
      }]
    },
    task_manage_list: {
      'data|30-50': [{
        effect: () => {
          return Mock.Random.boolean()
        },
        expired: () => {
          return Mock.Random.boolean()
        },
        name: () => {
          return Mock.Random.cname()
        },
        station: () => {
          return Mock.Random.cword(3, 5)
        },
        status: () => {
          return Mock.Random.integer(0, 5)
        },
        tag: () => {
          return Mock.Random.cword(2)
        },
        time: () => {
          return Mock.Random.time('HH:mm')
        },
        title: () => {
          return Mock.Random.ctitle(5, 10)
        }
      }]
    }
  })
}
